home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 21 / Cream of the Crop 21 (Terry Blount) (October 1996).iso / os2 / commo70.zip / MOSTHOST.MAC < prev    next >
Text File  |  1996-08-24  |  25KB  |  770 lines

  1.                         MOSTHOST.MAC (Regular version)
  2.                         by Shad Muegge and Fred Brucker
  3.  
  4. {:setup}                          * Set up MOSTHOST options
  5. -------------------------------------------------------------------------------
  6. -Configuration Items--------------Description----------------------------------
  7. -------------------------------------------------------------------------------
  8.  {LIGH Y}                         Modem signal lights
  9.  {SETV dospassword,PASSWORD}      Password to access the DOS menu
  10.  {SETV filedir,%_hom%MHFILE\}     Directory for file transfer files
  11.  {SETV datadir,%_hom%MHDATA\}     Directory for user data file
  12.  {SETV hotkeys,n}                 Hot keys (y/n)
  13.  {SETV inact_time,120}            Inactivity timer, seconds
  14.  {SETV ring_string,RING}          String sent from modem to indicate a ring
  15.  {SETV connect_string,CONNECT}    Result string for a successful connection
  16. -------------------------------------------------------------------------------
  17.  
  18.         {SETV pr_alarm,0}                   * Turn off protocol alarms
  19.         {SETG %inact_time,time_out}         * Set up GETString timer
  20.         {RTRA y,9,0}                        * Filter tabs from input
  21.         {CLEA}
  22.         {PARM ,,,A}
  23.         {SPOC y}
  24.         {LOCA y}
  25.         {SETE WF3}
  26.         {RETURN}
  27.  
  28. --------------------------------------------* General functions ---------------
  29. {:cls}                                      * Clear the screen
  30.         {SEND ^L}
  31.         {RETURN}
  32.  
  33. {:press_any_key}                            * Pause until a key is pressed
  34.         {SEND ^J^MPress Any Key:}
  35.         {GETS-H temp,1,PK}
  36. {:PK}   {setv temp}
  37.         {SEND ^J^M}
  38.         {RETURN}
  39.  
  40. {:dsp_file}                                 * Display a file
  41.         {IFEX %dump_file,,DF5}              * IN: %dump_file
  42.         {SETV count,0}
  43.         {ROPE %dump_file,DF3}
  44. {:DF1}  {READ dline}
  45.         {SEND ^M%dline^J^M}
  46.         {INCR count}
  47.         {COMP count,23}   {IFCO DF4}
  48.         {GOTO DF1}
  49. {:DF2}  {RCLOSE}
  50. {:DF3}  {SETV dline}
  51.         {SETV ch}
  52.         {SETV count}
  53.         {RETURN}
  54. {:DF4}  {SETV count,0}
  55.         {SEND ^MMore [Y],N,C: }
  56.         {CALL get_key}
  57.         {IFCO DF1}
  58.         {COMP ch,n}   {IFCO DF2}
  59.         {COMP ch,y}   {IFCO DF1}
  60.         {COMP ch,c}   {IFCO ,DF4}
  61.         {SETV count,26}
  62.         {GOTO DF1}
  63. {:DF5}  {SEND ^J^M^GError: File not found: %dump_file}
  64.         {CALL press_any_key}
  65.         {RETURN}
  66.  
  67. {:menu}                                     * Get menu selection
  68.         {SEND %prompt [%_tim]: }            * OUT: %ch
  69.         {CALL get_key}                      * %ch = ~, if user hit CR at prompt
  70.         {IFCO MN1}
  71.         {SEND ^J^M}
  72.         {COMP ch,*}   {IFCO time_out}
  73.         {GOTO MN2}
  74. {:MN1}  {SETV ch,~}
  75.         {SEND ^J^M}
  76. {:MN2}  {RETURN}
  77.  
  78. {:get_key}
  79.         {COMP hotkeys,y} {IFCO GK1}
  80.         {GETS ch,1}
  81.         {GOTO GK2}
  82. {:GK1}  {GETS-H ch,1}
  83. {:GK2}  {COMP ch}
  84.         {RETURN}
  85.  
  86. {:get_protocol}                             * Get protcol selection
  87.         {PAUS-T 2}
  88.         {CALL cls}                          * OUT: %protocol
  89.         {SEND ┌───────────────────────────────────────────────────┐^J^M}
  90.         {SEND │                    Protocols                      │^J^M}
  91.         {SEND └───────────────────────────────────────────────────┘^J^M}
  92.         {SEND                     [Y] Ymodem^J^M}
  93.         {SEND                     [G] Ymodem-G^J^M}
  94.         {SEND                     [X] Xmodem^J^M}
  95.         {SEND                     [Z] Zmodem^J^M}
  96.         {SEND                     [H] HS/Link^J^M^J^M}
  97.         {SETV prompt,Protocol:}
  98.         {CALL menu}
  99.         {COMP ch,~}   {IFCO PG2}
  100.         {COMP ch,z}   {IFCO PG1}
  101.         {COMP ch,y}   {IFCO PG1}
  102.         {COMP ch,g}   {IFCO PG1}
  103.         {COMP ch,x}   {IFCO PG1}
  104.         {COMP ch,h}   {IFCO ,PG2}
  105. {:PG1}  {SETV protocol,%ch}
  106. {:PG2}  {RETURN}
  107.  
  108. {:send_hslink}                              * HSLINK download subroutine
  109.         {SEND ^J^MStart your HS/Link download now.^J^M}
  110.         {CALL h_send}
  111.         {COMP %_err,0}
  112.         {RETURN}
  113.  
  114. {:send_zmodem}                              * ZMODEM download subroutine
  115.         {SEND ^J^MStart your Zmodem download now.^J^M}
  116.         {CALL z_send}
  117.         {COMP %_err,0}
  118.         {RETURN}
  119.  
  120. {:send_ymodem}                              * YMODEM download subroutine
  121.         {SEND ^J^MStart your Ymodem download now.^J^M}
  122.         {CALL yb_send}
  123.         {COMP %_err,0}
  124.         {RETURN}
  125.  
  126. {:send_xmodem}                              * XMODEM-1K download subroutine
  127.         {SEND ^J^MStart your Xmodem download now.^J^M}
  128.         {IFEX %pr_file,,SX1}
  129.         {CALL xk_send}
  130.         {COMP %_err,0}
  131. {:SX1}  {RETURN}
  132.  
  133. {:recv_hslink}                              * HSLINK upload subroutine
  134.         {SEND ^J^MStart your HS/Link upload now.^J^M}
  135.         {CALL h_recv}
  136.         {COMP %_err,0}
  137.         {RETURN}
  138.  
  139. {:recv_zmodem}                              * ZMODEM upload subroutine
  140.         {SEND ^J^MStart your Zmodem upload now.^J^M}
  141.         {CALL z_recv}
  142.         {COMP %_err,0}
  143.         {RETURN}
  144.  
  145. {:recv_ymodem}                              * YMODEM upload subroutine
  146.         {SEND ^J^MStart your Ymodem upload now.^J^M}
  147.         {CALL yb_recv}
  148.         {COMP %_err,0}
  149.         {RETURN}
  150.  
  151. {:recv_yg}                                  * YMODEM-G upload subroutine
  152.         {SEND ^J^MStart your Ymodem-G upload now.^J^M}
  153.         {CALL yg_recv}
  154.         {COMP %_err,0}
  155.         {RETURN}
  156.  
  157. {:recv_xmodem}                              * XMODEM-1K upload subroutine
  158.         {SEND ^J^MStart your Xmodem upload now.^J^M}
  159.         {CALL xc_recv}
  160.         {COMP %_err,0}
  161.         {RETURN}
  162.  
  163. {:transfer_file}                            * Transfer a file upload & download
  164.         {PUSH DL2}
  165.         {COMP proto,sz} {IFCO send_zmodem}  * IN: %proto
  166.         {COMP proto,sy} {IFCO send_ymodem}  *   s + %protocol for downloads
  167.         {COMP proto,sg} {IFCO send_ymodem}  *   r + %protocol for uploads
  168.         {COMP proto,sx} {IFCO send_xmodem}
  169.         {COMP proto,sh} {IFCO send_hslink}
  170.         {COMP proto,rz} {IFCO recv_zmodem}
  171.         {COMP proto,ry} {IFCO recv_ymodem}
  172.         {COMP proto,rg} {IFCO recv_yg}
  173.         {COMP proto,rx} {IFCO recv_xmodem}
  174.         {COMP proto,rh} {IFCO recv_hslink}
  175.         {SEND ^J^MInvalid protocol ^J^M}
  176.         {CALL press_any_key}
  177.         {COMP proto,sz}                     * Set a bad condition for return
  178. {:DL1}  {SETV proto}
  179.         {POPS}
  180.         {RETURN}
  181. {:DL2}  {PAUS 2}
  182.         {RETURN}
  183.  
  184. {:get_name}
  185.         {SEND ^J^J^MEnter your name: }      * Get a name from user
  186.         {GETS lname}                        * OUT: %lname
  187.         {COMP lname}                        * OUT: cond. flag set if null
  188.         {RETURN}
  189.  
  190. {:get_password}                             * Get a password
  191.         {GETS-P pass}
  192.         {RETURN}
  193.  
  194. {:time_out}                                 * Time out user
  195.         {POPS-C}                            * Clear the stack
  196.         {GOTO GBY}
  197.  
  198. {:write_user}                               * Update user record in user file
  199.         {ROPE %datadir%USER.MHS,WU3}
  200.         {WOPE %datadir%$$$TEMP.MHS}
  201. {:WU1}  {CALL read_rec}
  202.         {COMP login_name,%u_temp1}
  203.         {IFCO WU2}
  204.         {CALL write_rec}
  205.         {GOTO WU1}
  206. {:WU2}  {CALL user_temp}
  207.         {CALL write_rec}
  208.         {GOTO WU1}
  209. {:WU3}  {POPS}  ** pop read_rec return addr
  210.         {WCLO}
  211.         {EXEC-N del %datadir%USER.MHS}
  212.         {EXEC-N ren %datadir%$$$TEMP.MHS USER.MHS}
  213.         {SETV u_temp1}
  214.         {SETV u_temp2}
  215.         {SETV u_temp3}
  216.         {RETURN}
  217.  
  218. {:write_rec}                                * Write a user record
  219.         {WRIT %u_temp1}                     * IN: name
  220.         {WRIT %u_temp2}                     * IN: password
  221.         {WRIT %u_temp3}                     * IN: protocol
  222.         {RETURN}
  223.  
  224. {:read_user}                                * Read a user record
  225.         {IFEX %datadir%USER.MHS,,RU3}       * IN: %login_name
  226.         {ROPE %datadir%USER.MHS,RU2}
  227. {:RU1}  {CALL read_rec}
  228.         {COMP lname,%u_temp1}
  229.